unit UPlanilha;

interface

uses
  SysUtils, Windows, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, ULinhas;

type
  TPlanilha = class (TObject)
  private
    FNCols: Integer;
    FNLins: Integer;
    procedure Add;
    procedure Create;
    property NCols: Integer read FNCols write FNCols;
    property NLins: Integer read FNLins write FNLins;
  public
    Linhas: Array[1..100] of TLinha;
    TituloColunas: Array[1..100] of ST100;
    TituloLinhas: Array[1..100] of ST100;
    procedure SetNCols(xNCols:integer);
    procedure SetNLins(xNLins:integer);
  end;
  

procedure Register;

implementation

procedure Register;
begin
end;

{
********************************** TPlanilha ***********************************
}
procedure TPlanilha.Add;
var
  Linha: TLinha;
begin
  Linha := TLinha.Create();
  Linha.SetNCols(NCols);
  Linhas[NLins] := Linha;
  Linha.Free;
end;

procedure TPlanilha.Create;
var
  i: Word;
begin
  for i := 1 to 100 do Add; // ajustar para NLins passado como parametro do create
end;

procedure TPlanilha.SetNCols(xNCols:integer);
begin
  if xNCols > 100 then xNCols := 100;
  NCols := XNCols;
end;

procedure TPlanilha.SetNLins(xNLins:integer);
begin
  if xNLins > 100 then xNLins := 100;
  Nlins := XNLins;
end;


end.
